/*
 *     Copyright 2000-2011 Francois de Bertrand de Beuvron
 * 
 *     This file is part of CoursBeuvron.
 * 
 *     CoursBeuvron is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     CoursBeuvron is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 * 
 *     You should have received a copy of the GNU General Public License
 *     along with CoursBeuvron.  If not, see <http://www.gnu.org/licenses/>.
 */
package fr.insa.beuvron.tps.m2.dessin2DV3.gui;

import fr.insa.beuvron.tps.m2.dessin2DV3.EnsembleFigure;
import fr.insa.beuvron.tps.m2.dessin2DV3.Point;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;

/**
 *
 * @author francois
 */
public class InterfacePartielle1 extends JPanel implements ActionListener {
    
    private PointPanel2 formPoint;
    private JButton jbCreer;
    
    private EnsembleFigure figs;
    
    public InterfacePartielle1(EnsembleFigure figs) {
        this.figs = figs;
        this.setLayout(new BorderLayout());
        this.formPoint = new PointPanel2();
        this.add(this.formPoint,BorderLayout.CENTER);
        this.jbCreer = new JButton("Ajouter Point");
        this.jbCreer.addActionListener(this);
        this.add(this.jbCreer,BorderLayout.SOUTH);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Point nouveau = new Point();
        this.formPoint.modifieObjet(nouveau);
        this.figs.ajouteFigure(nouveau);
    }
    
}
